package database

import "database/sql"

// JobType represents the type of job for a monitor.
type JobType string

const (
	JobTypeTCP  JobType = "tcp"
	JobTypeUDP  JobType = "udp"
	JobTypeHTTP JobType = "http"
	JobTypeDNS  JobType = "dns"
)

type Monitor struct {
	ID              int            `db:"id"`
	Active          bool           `db:"active"`
	WorkspaceID     int            `db:"workspace_id"`
	JobType         JobType        `db:"job_type"`
	Periodicity     string         `db:"periodicity"`
	URL             string         `db:"url"`
	Headers         string         `db:"headers"`
	Body            string         `db:"body"`
	Method          string         `db:"method"`
	Timeout         int64          `db:"timeout"`
	DegradedAfter   sql.NullInt64  `db:"degraded_after"`
	Assertions      sql.NullString `db:"assertions"`
	Retry           int            `db:"retry"`
	FollowRedirects bool           `db:"follow_redirects"`
	OtelEndpoint    sql.NullString `db:"otel_endpoint" json:"-"`
	OtelHeaders     sql.NullString `db:"otel_headers" json:"-"`
	Name            string         `db:"name" json:"-"`
	Description     string         `db:"description" json:"-"`
	CreatedAt       int            `db:"created_at" json:"-"`
	UpdatedAt       int            `db:"updated_at" json:"-"`
	DeletedAt       sql.NullInt64  `db:"deleted_at" json:"-"`
	Regions         string         `db:"regions" json:"-"`
	Status          string         `db:"status" json:"-"`
	Public          bool           `db:"public" json:"-"`
}

type PrivateLocation struct {
	ID int `db:"id"`
}
